import cn.hutool.crypto.digest.BCrypt;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.project.fortuneteller.FortunetellerApplication;
import com.project.fortuneteller.mappers.UserMapper;
import com.project.fortuneteller.pojo.User;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;


@SpringBootTest(classes = FortunetellerApplication.class)
public class test {


    public static void main(String[] args) {

//        String password = "1010";
//        String hashedPassword1 = BCrypt.hashpw(password, BCrypt.gensalt());
//        System.out.println("BCrypt Hashed Password: " + hashedPassword1);
//
//        System.out.println("  =================================================  ");
//
//        String password1 = "1010";
////        String hashedPassword2 = BCrypt.hashpw(password1, BCrypt.gensalt());
//
//        boolean matches = BCrypt.checkpw(password, hashedPassword1);
//        System.out.println("Password Matches: " + matches);

        String metadata = "{\"userid\":\"12\",\"role\":\"11\"}";

        JSONObject entries = JSONUtil.parseObj(metadata);
        String o = (String) entries.get("userid");
        System.out.println(o);

    }




    @Resource
    public UserMapper userMapper;

    @Test
    public void testMysql() {
        User byId = userMapper.getById(1);
        System.out.println(byId);

    }


}
